
DIR="$( pwd; )/$( dirname -- "$0"; )"

cd $DIR

if [ "$@" = "setup" ]; then
	sudo xbps-install -S \
		wayland                    \
		wayland-protocols          \
		wlroots                    \
		wayland-devel              \
		wlroots-devel              \
		xorg-server-xwayland       \
		git                        \
		stow                       \
		gcc                        \
		make                       \
		flatpak                    \
		wget                       \
		nushell                    \
		alacritty                  \
		bemenu                     \
		slurp                      \
		grim                       \
		light                      \
		mako                       \
		pamixer                    \
		sway                       \
		autotiling                 \
		Waybar                     \
		swaybg                     \
		swaylock                   \
		swayidle                   \
		wlogout                    \
		font-liberation-ttf

	chsh -s /usr/bin/nu

	sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

	sudo flatpak install \
		io.gitlab.librewolf-community \
		com.valvesoftware.Steam
fi

if [ "$@" = "bin" ]; then
	for script in $(find bin/*); do
		sudo rm -f /usr/local/$script
		sudo cp $script /usr/local/bin/
	done
fi

if [ "$@" = "home" ]; then
	#stow -d $DIR -S home
	stow home
fi
